package anthology.daily_question._25_01;
//https://leetcode.cn/problems/shortest-subarray-with-or-at-least-k-i/description/?envType=daily-question&envId=2025-01-16
public class _3095或值至少K的最短子数组1 {
    class Solution {
        public int minimumSubarrayLength(int[] nums, int k) {
            int res = Integer.MAX_VALUE;
            for(int i=0; i<nums.length; i++){
                int tmp = 0;
                for(int j=i; j<nums.length; j++){
                    tmp |= nums[j];
                    if(tmp >= k){
                        res = Math.min(res,j-i+1);
                        break;
                    }
                }
            }
            return res == Integer.MAX_VALUE ? -1 : res;
        }
    }
}
